import request from '@/utils/request'

export function getEmployeeListAPI(data) {
  return request({
    url: '/admin/site/getSites',
    method: 'post',
    data
  })
}
// 人员
export function peoplesAPI(data) {
  return request({
    url: '/admin/site/getSiteUsers',
    method: 'post',
    data: {
      site_id: data.site_id,
      page: data.page,
      listRows: data.listRows
    }
  })
}
// 添加 人员
export function addpeoplesAPI(data) {
  console.log(data)
  return request({
    url: '/admin/site/addSiteUser',
    method: 'post',
    data: {
      site_id: data.site_id,
      user_id: data.user_id,
      name: data.name,
      mobile: data.mobile
    }
  })
}
// 上传图片
export function addimgAPI(file) {
  const fm = new FormData()
  fm.append('image', file)
  return request({
    url: '/admin/common/uploadImage',
    method: 'post',
    data: fm
  })
}
// 搜索人员
export function searchaddAPI(data) {
  return request({
    url: '/admin/user/searchUser',
    method: 'post',
    data: {
      mobile: data.mobiles
    }
  })
}
// 删除。
export function rompeopleAPI(data) {
  return request({
    url: '/admin/user/searchUser',
    method: 'post',
    data: {
      mobile: data.mobiles
    }
  })
}
